package realm.inorder.itmill.ui.panel.logged.cadastro.cliente;

import realm.inorder.itmill.ui.menu.MenuBuilder;
import realm.inorder.itmill.ui.menu.MenuOption;
import realm.inorder.itmill.ui.menu.MenuPanel;
import realm.inorder.itmill.ui.menu.SimpleMenuOption;
import realm.inorder.itmill.ui.panel.logged.cadastro.AbstractLoggedContentPanel;

import com.itmill.toolkit.ui.Layout;
import com.itmill.toolkit.ui.Button.ClickEvent;

public abstract class AbstractClientePanel extends AbstractLoggedContentPanel implements MenuBuilder {

	public AbstractClientePanel() {
		super();
	}

	public AbstractClientePanel(Layout layout) {
		super(layout);
	}

	public AbstractClientePanel(String caption, Layout layout) {
		super(caption, layout);
	}

	public AbstractClientePanel(String caption) {
		super(caption);
	}

	protected MenuOption cadastrarClienteMenuOption = new SimpleMenuOption("Cadastrar Cliente *") {
		@Override
		public void performAction(ClickEvent clickEvent) {
			// TODO abrir tela de cadastro de cliente limpa
			loggedLayoutController.showClienteCadastroPanel();
		}
	};

	protected MenuOption listarClienteMenuOption = new SimpleMenuOption("Listar Clientes *") {
		@Override
		public void performAction(ClickEvent clickEvent) {
			// TODO abrir tela de cadastro de cliente limpa
			loggedLayoutController.showClienteCadastroPanel();
		}
	};
	
	public void makeMenu(MenuPanel menuPanel) {
		super.makeMenu(menuPanel);
		
		menuPanel.addMenuOptionBefore(logoutMenuOption, cadastrarClienteMenuOption);
	}

}
